stage.set_background_color("lightblue")
# sprite = codesters.Rectangle(x, y, width, height, "color")
sprite = codesters.Rectangle(0, 0, 700, 100, "gold")
sprite.turn_left(45)
# sprite = codesters.Rectangle(x, y, width, height, "color")
sprite = codesters.Rectangle(0, 0, 700, 100, "gold")
sprite.turn_right(45)
sprite = codesters.Sprite("earth")
people_sprites = ['person1', 'person2', 'person3', 'person4', 'person5', 'person6',
'person7', 'person8','person9', 'person10', 'person11', 'person12']
rotate = 90
t = codesters.Teacher()
try:
tval1 = t.find_block('for')
except:
tval1 = "DNE"
try:
params = t.find_function('Sprite')
tval2 = t.get_indent_at_line(params[1][0])
except:
tval2 = "DNE"
t1 = TestObjective()
t1.add_success(tval1 == 4, "Great job!")
t1.add_failure(tval1 == [], "Did you drag out a Loop through List block?")
t1.add_failure(tval1 == "DNE", "Did you drag out a Loop through List block?")
t2 = TestObjective()
t2.add_success(tval2 == 4, "Great job!")
t2.add_failure(tval2 == 0, "Did you indent Sprite at Position under the for loop?")
t2.add_failure(tval2 > 4 and tval2 != "DNE", "You indented Sprite at Position too far.")
t2.add_failure(tval2 == "DNE", "Did you add a Sprite at Position command?")
tester = TestManager()
tester.add_test_list([t1, t2])
tester.run_tests()
tester.display_first_feedback()
-
Run Code
-
Activity Submitted!
Submit Work
-
Next Activity
-
Stop Running Code
-
Show Chart
-
Show Console
-
Reset Code Editor
-
Codesters How To (opens in a new tab)